package ibm.cognos.imt;

import com.cognos.developer.schemas.bibus._3.MetadataService_PortType;
import com.cognos.developer.schemas.bibus._3.MetadataService_ServiceLocator;

import javax.xml.rpc.ServiceException;
import java.net.URL;

/**
 * Created with IntelliJ IDEA.
 * User: eric
 * Date: 2/20/14
 * Time: 9:32 AM
 * To change this template use File | Settings | File Templates.
 */
public class MetadataServiceUtil {


    public void getMetadata(URL serverUrl) {
        MetadataService_ServiceLocator metadataServiceLocator =
                new MetadataService_ServiceLocator();

        MetadataService_PortType metadataService = null;

        try
        {
//            repService = reportServiceLocator.getreportService(new URL(Cognos_URL));
            metadataService = metadataServiceLocator.getmetadataService(serverUrl);
        }
//        catch (MalformedURLException ex)
//        {
//            System.out.println(
//                    "Caught a MalformedURLException:" + ex.getMessage());
//            System.out.println("Server URL was: " + Cognos_URL);
//            System.exit(-1);
//        }
        catch (ServiceException ex)
        {
            System.out.println("Caught a ServiceException: " + ex.getMessage());
            ex.printStackTrace();
            System.exit(-1);
        }
//        metadataService.queryMetadata()
    }
}
